/*
 *
 *方法的整理与重构
 *
 *
 */

//定义app参数名称，并加载其它模块
var authApp=angular.module('authapp', ["ngCookies",'ngFileUpload','ui.bootstrap']);

//此为定位页面所用
authApp.value('page','feedback');

/*controller部分*/


//定义父controller，主要用于controller之间传递信息
authApp.controller("fcontroller",function($scope,$http){
})


//主要操作controller
authApp.controller("opinionListcontroller",function($scope,$http,$cookies){
	$scope.accounttype = $cookies.get('accounttype')
    //针对此页面需要的参数 should edit
    $scope.isAddM=true;
    $scope.isAddPwd=true;
    $scope.isclickBtn=false;

    //**********主体方法
    var queryMainApi=apis.querySchoolByExpert;//！！！should edit
    $scope.queryMain=function(){
        $http({
            method:'post',
            url:queryMainApi,
           data:{},
        }).success(function(response){
            if(response.code=="000000"){
                $scope.queryMainApiCallBack(response);
            }else{
                alert(response.errorMsg);
            }
        }).error(function(){
            alert("网络出现故障，请确认网络是否连接");
        })
    }

    $scope.queryMain();

    /*下面为自已编辑部分*/

    //调用主接口成功之后的处理方法
    $scope.queryMainApiCallBack=function(response){
        $scope.list=response.data;
    }

    $scope.turnTo=function(schoolId,schoolName){
        location.href="table6.html?schoolId="+schoolId+"&schoolName="+encodeURIComponent(encodeURIComponent(schoolName));
    }
    $scope.download=function(schoolId){
    	location.href=apis.downfeedBack+"?schoolId="+schoolId;
    }
    function toUnicode(str)
    {
        return escape(str).replace(/%/g,"\\").toLowerCase();
    }
})

